home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / rpunch.c < prev    next >
C/C++ Source or Header  |  2000-05-06  |  33KB  |  920 lines

  1. /***************************************************************************
  2.  
  3.     Rabbit Punch / Rabio Lepus
  4.  
  5.     driver by Aaron Giles
  6.  
  7. ****************************************************************************
  8.  
  9.     Memory map
  10.  
  11. ****************************************************************************
  12.  
  13.     ========================================================================
  14.     MAIN CPU
  15.     ========================================================================
  16.     000000-03FFFF   R     xxxxxxxx xxxxxxxx   Program ROM
  17.     040000-04FFFF   R/W   xxxxxxxx xxxxxxxx   Bitmap RAM (512x256 pixels)
  18.                     R/W   xxxx---- --------      (leftmost pixel)
  19.                     R/W   ----xxxx --------      (2nd pixel)
  20.                     R/W   -------- xxxx----      (3rd pixel)
  21.                     R/W   -------- ----xxxx      (rightmost pixel)
  22.     060000-060FFF   R/W   xxxxxxxx xxxxxxxx   Sprite RAM (512 entries x 4 words)
  23.                     R/W   -------x xxxxxxxx      (0: horizontal position)
  24.                     R/W   xxx----- --------      (1: color index)
  25.                     R/W   ---x---- --------      (1: horizontal flip)
  26.                     R/W   -----xxx xxxxxxxx      (1: image number)
  27.                     R/W   -------x xxxxxxxx      (2: Y position)
  28.                     R/W   -------- --------      (3: not used)
  29.     080000-081FFF   R/W   xxxxxxxx xxxxxxxx   Background 1 RAM (64x64 tiles)
  30.                     R/W   xxx----- --------      (color index)
  31.                     R/W   ---xxxxx xxxxxxxx      (image number)
  32.     082000-083FFF   R/W   xxxxxxxx xxxxxxxx   Background 2 RAM (64x64 tiles)
  33.                     R/W   xxx----- --------      (color index)
  34.                     R/W   ---xxxxx xxxxxxxx      (image number)
  35.     0A0000-0A01FF   R/W   -xxxxxxx xxxxxxxx   Background 1 palette RAM (256 entries)
  36.                     R/W   -xxxxx-- --------      (red component)
  37.                     R/W   ------xx xxx-----      (green component)
  38.                     R/W   -------- ---xxxxx      (blue component)
  39.     0A0200-0A03FF   R/W   -xxxxxxx xxxxxxxx   Background 2 palette RAM (256 entries)
  40.     0A0400-0A05FF   R/W   -xxxxxxx xxxxxxxx   Bitmap palette RAM (256 entries)
  41.     0A0600-0A07FF   R/W   -xxxxxxx xxxxxxxx   Sprite palette RAM (256 entries)
  42.     0C0000            W   -------x xxxxxxxx   Background 1 vertical scroll
  43.     0C0002            W   -------x xxxxxxxx   Background 1 horizontal scroll
  44.     0C0004            W   -------x xxxxxxxx   Background 2 vertical scroll
  45.     0C0006            W   -------x xxxxxxxx   Background 2 horizontal scroll
  46.     0C0008            W   -------- ????????   Video controller data (CRTC)
  47.     0C000C            W   ---xxx-- -xxxxxxx   Video flags
  48.                       W   ---x---- --------      (flip screen)
  49.                       W   ----x--- --------      (background 2 image bank)
  50.                       W   -----x-- --------      (background 1 image bank)
  51.                       W   -------- -x------      (sprite palette bank)
  52.                       W   -------- --x-----      (background 2 palette bank)
  53.                       W   -------- ---x----      (background 1 palette bank)
  54.                       W   -------- ----xxxx      (bitmap palette bank)
  55.     0C000E            W   -------- xxxxxxxx   Sound communications
  56.     0C0010            W   -------- --xxxxxx   Sprite bias (???)
  57.     0C0012            W   -------- --xxxxxx   Bitmap bias (???)
  58.     0C0018          R     -xxxx-xx --xxxxxx   Player 1 input port
  59.                     R     -x------ --------      (2 player start)
  60.                     R     --x----- --------      (1 player start)
  61.                     R     ---x---- --------      (coin 1)
  62.                     R     ----x--- --------      (coin 2)
  63.                     R     ------x- --------      (test switch)
  64.                     R     -------x --------      (service coin)
  65.                     R     -------- --x-----      (punch button)
  66.                     R     -------- ---x----      (missile button)
  67.                     R     -------- ----xxxx      (joystick right/left/down/up)
  68.     0C001A          R     -xxxx-xx --xxxxxx   Player 2 input port
  69.     0C001C          R     xxxxxxxx xxxxxxxx   DIP switches
  70.                     R     x------- --------      (flip screen)
  71.                     R     -x------ --------      (continues allowed)
  72.                     R     --x----- --------      (demo sounds)
  73.                     R     ---x---- --------      (extended play)
  74.                     R     ----x--- --------      (laser control)
  75.                     R     -----x-- --------      (number of lives)
  76.                     R     ------xx --------      (difficulty)
  77.                     R     -------- xxxx----      (coinage 2)
  78.                     R     -------- ----xxxx      (coinage 1)
  79.     0C001E          R     -------- -------x   Sound busy flag
  80.     0C0028            W   -------- ????????   Video controller register select (CRTC)
  81.     0FC000-0FFFFF   R/W   xxxxxxxx xxxxxxxx   Program RAM
  82.     ========================================================================
  83.     Interrupts:
  84.         IRQ1 = VBLANK
  85.     ========================================================================
  86.  
  87.  
  88.     ========================================================================
  89.     SOUND CPU
  90.     ========================================================================
  91.     0000-EFFF   R     xxxxxxxx   Program ROM
  92.     F000-F001   R/W   xxxxxxxx   YM2151 communications
  93.     F200        R     xxxxxxxx   Sound command input
  94.     F400          W   x------x   UPD7759 control
  95.                   W   x-------      (/RESET line)
  96.                   W   -------x      (ROM bank select)
  97.     F600          W   xxxxxxxx   UPD7759 data/trigger
  98.     F800-FFFF   R/W   xxxxxxxx   Program RAM
  99.     ========================================================================
  100.     Interrupts:
  101.         IRQ = YM2151 IRQ or'ed with the sound command latch flag
  102.     ========================================================================
  103.  
  104. ***************************************************************************/
  105.  
  106.  
  107. #include "driver.h"
  108. #include "cpu/m6809/m6809.h"
  109. #include "vidhrdw/generic.h"
  110. #include <math.h>
  111.  
  112.  
  113.  
  114. #define MASTER_CLOCK        16000000
  115. #define UPD_CLOCK            640000
  116.  
  117.  
  118. /* video driver data & functions */
  119. int rpunch_vh_start(void);
  120. void rpunch_vh_stop(void);
  121. void rpunch_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  122.  
  123. extern UINT8 *rpunch_bitmapram;
  124. extern size_t rpunch_bitmapram_size;
  125. extern int rpunch_sprite_palette;
  126.  
  127. static UINT8 sound_data;
  128. static UINT8 sound_busy;
  129. static UINT8 ym2151_irq;
  130. static UINT8 upd_rom_bank;
  131.  
  132. WRITE_HANDLER(rpunch_bitmap_w);
  133. WRITE_HANDLER(rpunch_videoram_w);
  134. WRITE_HANDLER(rpunch_videoreg_w);
  135. WRITE_HANDLER(rpunch_scrollreg_w);
  136. WRITE_HANDLER(rpunch_ins_w);
  137. WRITE_HANDLER(rpunch_crtc_data_w);
  138. WRITE_HANDLER(rpunch_crtc_register_w);
  139.  
  140.  
  141.  
  142. /*************************************
  143.  *
  144.  *    Interrupt handling
  145.  *
  146.  *************************************/
  147.  
  148. static void ym2151_irq_gen(int state)
  149. {
  150.     ym2151_irq = state;
  151.     cpu_set_irq_line(1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE);
  152. }
  153.  
  154.  
  155. static void init_machine(void)
  156. {
  157.     memcpy(memory_region(REGION_SOUND1), memory_region(REGION_SOUND1) + 0x20000, 0x20000);
  158. }
  159.  
  160.  
  161.  
  162. /*************************************
  163.  *
  164.  *    Input ports
  165.  *
  166.  *************************************/
  167.  
  168. READ_HANDLER(common_port_r)
  169. {
  170.     return readinputport(offset / 2) | readinputport(2);
  171. }
  172.  
  173.  
  174.  
  175. /*************************************
  176.  *
  177.  *    Sound I/O
  178.  *
  179.  *************************************/
  180.  
  181. void sound_command_w_callback(int data)
  182. {
  183.     sound_busy = 1;
  184.     sound_data = data;
  185.     cpu_set_irq_line(1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE);
  186. }
  187.  
  188.  
  189. WRITE_HANDLER(sound_command_w)
  190. {
  191.     if (!(data & 0x00ff0000))
  192.         timer_set(TIME_NOW, data & 0xff, sound_command_w_callback);
  193. }
  194.  
  195.  
  196. READ_HANDLER(sound_command_r)
  197. {
  198.     sound_busy = 0;
  199.     cpu_set_irq_line(1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE);
  200.     return sound_data;
  201. }
  202.  
  203.  
  204. READ_HANDLER(sound_busy_r)
  205. {
  206.     return sound_busy;
  207. }
  208.  
  209.  
  210.  
  211. /*************************************
  212.  *
  213.  *    UPD7759 controller
  214.  *
  215.  *************************************/
  216.  
  217. WRITE_HANDLER(upd_control_w)
  218. {
  219.     if ((data & 1) != upd_rom_bank)
  220.     {
  221.         upd_rom_bank = data & 1;
  222.         memcpy(memory_region(REGION_SOUND1), memory_region(REGION_SOUND1) + 0x20000 * (upd_rom_bank + 1), 0x20000);
  223.     }
  224.     UPD7759_reset_w(0, data >> 7);
  225. }
  226.  
  227.  
  228. WRITE_HANDLER(upd_data_w)
  229. {
  230.     UPD7759_message_w(0, data);
  231.     UPD7759_start_w(0, 0);
  232.     UPD7759_start_w(0, 1);
  233. }
  234.  
  235.  
  236.  
  237. /*************************************
  238.  *
  239.  *    Mirroring (20bit -> 24bit)
  240.  *
  241.  *************************************/
  242.  
  243. static READ_HANDLER(mirror_r)
  244. {
  245.     return cpu_readmem24bew_word(offset & 0xfffff);
  246. }
  247.  
  248.  
  249. static WRITE_HANDLER(mirror_w)
  250. {
  251.     if (!(data & 0xffff0000))
  252.         cpu_writemem24bew_word(offset & 0xfffff, data);
  253.     else if (!(data & 0xff000000))
  254.         cpu_writemem24bew(offset & 0xfffff, (data >> 8) & 0xff);
  255.     else
  256.         cpu_writemem24bew((offset & 0xfffff) + 1, data & 0xff);
  257. }
  258.  
  259.  
  260.  
  261. /*************************************
  262.  *
  263.  *    Main CPU memory handlers
  264.  *
  265.  *************************************/
  266.  
  267. static struct MemoryReadAddress readmem[] =
  268. {
  269.     { 0x000000, 0x03ffff, MRA_ROM },
  270.     { 0x040000, 0x04ffff, MRA_BANK1 },
  271.     { 0x060000, 0x060fff, MRA_BANK2 },
  272.     { 0x080000, 0x083fff, MRA_BANK3 },
  273.     { 0x0c0018, 0x0c001b, common_port_r },
  274.     { 0x0c001c, 0x0c001d, input_port_3_r },
  275.     { 0x0c001e, 0x0c001f, sound_busy_r },
  276.     { 0x0a0000, 0x0a07ff, MRA_BANK4 },
  277.     { 0x0fc000, 0x0fffff, MRA_BANK5 },
  278.     { 0x100000, 0xffffff, mirror_r },
  279.     { -1 }  /* end of table */
  280. };
  281.  
  282.  
  283. static struct MemoryWriteAddress writemem[] =
  284. {
  285.     { 0x000000, 0x03ffff, MWA_ROM },
  286.     { 0x040000, 0x04ffff, rpunch_bitmap_w, &rpunch_bitmapram, &rpunch_bitmapram_size },
  287.     { 0x060000, 0x060fff, MWA_BANK2, &spriteram, &spriteram_size },
  288.     { 0x080000, 0x083fff, rpunch_videoram_w, &videoram, &videoram_size },
  289.     { 0x0a0000, 0x0a07ff, paletteram_xRRRRRGGGGGBBBBB_word_w, &paletteram },
  290.     { 0x0c0000, 0x0c0007, rpunch_scrollreg_w },
  291.     { 0x0c0008, 0x0c0009, rpunch_crtc_data_w },
  292.     { 0x0c000c, 0x0c000d, rpunch_videoreg_w },
  293.     { 0x0c000e, 0x0c000f, sound_command_w },
  294.     { 0x0c0010, 0x0c0013, rpunch_ins_w },
  295.     { 0x0c0028, 0x0c0029, rpunch_crtc_register_w },
  296.     { 0x0fc000, 0x0fffff, MWA_BANK5 },
  297.     { 0x100000, 0xffffff, mirror_w },
  298.     { -1 }  /* end of table */
  299. };
  300.  
  301.  
  302.  
  303. /*************************************
  304.  *
  305.  *    Sound CPU memory handlers
  306.  *
  307.  *************************************/
  308.  
  309. static struct MemoryReadAddress readmem_sound[] =
  310. {
  311.     { 0x0000, 0xefff, MRA_ROM },
  312.     { 0xf000, 0xf001, YM2151_status_port_0_r },
  313.     { 0xf200, 0xf200, sound_command_r },
  314.     { 0xf800, 0xffff, MRA_RAM },
  315.     { -1 }  /* end of table */
  316. };
  317.  
  318.  
  319. static struct MemoryWriteAddress writemem_sound[] =
  320. {
  321.     { 0x0000, 0xefff, MWA_ROM },
  322.     { 0xf000, 0xf000, YM2151_register_port_0_w },
  323.     { 0xf001, 0xf001, YM2151_data_port_0_w },
  324.     { 0xf400, 0xf400, upd_control_w },
  325.     { 0xf600, 0xf600, upd_data_w },
  326.     { 0xf800, 0xffff, MWA_RAM },
  327.     { -1 }  /* end of table */
  328. };
  329.  
  330.  
  331.  
  332. /*************************************
  333.  *
  334.  *    Port definitions
  335.  *
  336.  *************************************/
  337.  
  338. INPUT_PORTS_START( rpunch )
  339.     PORT_START    /* c0018 lower 8 bits */
  340.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  341.     PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  342.     PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  343.     PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  344.     PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  345.     PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
  346.     PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED )
  347.  
  348.     PORT_START    /* c001a lower 8 bits */
  349.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  350.     PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  351.     PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  352.     PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  353.     PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  354.     PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  355.     PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED )
  356.  
  357.     PORT_START    /* c0018/c001a upper 8 bits */
  358.     PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
  359.     PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
  360.     PORT_SERVICE( 0x0200, IP_ACTIVE_HIGH )
  361.     PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
  362.     PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_COIN2 )
  363.     PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_COIN1 )
  364.     PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START1 )
  365.     PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_START2 )
  366.     PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
  367.  
  368.     PORT_START    /* c001c DIP switches */
  369.     PORT_DIPNAME( 0x000f, 0x0000, DEF_STR( Coin_A ))
  370.     PORT_DIPSETTING(      0x000d, DEF_STR( 3C_1C ))
  371.     PORT_DIPSETTING(      0x000c, DEF_STR( 2C_1C ))
  372.     PORT_DIPSETTING(      0x0005, "6 Coins/4 Credits")
  373.     PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
  374.     PORT_DIPSETTING(      0x0003, "5 Coins/6 Credits" )
  375.     PORT_DIPSETTING(      0x0002, DEF_STR( 4C_5C ))
  376.     PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C ))
  377.     PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ))
  378.     PORT_DIPSETTING(      0x0009, DEF_STR( 1C_3C ))
  379.     PORT_DIPSETTING(      0x000a, DEF_STR( 1C_4C ))
  380.     PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ))
  381.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_6C ))
  382.     PORT_DIPNAME( 0x00f0, 0x0000, DEF_STR( Coin_B ))
  383.     PORT_DIPSETTING(      0x00d0, DEF_STR( 3C_1C ))
  384.     PORT_DIPSETTING(      0x00c0, DEF_STR( 2C_1C ))
  385.     PORT_DIPSETTING(      0x0050, "6 Coins/4 Credits")
  386.     PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
  387.     PORT_DIPSETTING(      0x0030, "5 Coins/6 Credits" )
  388.     PORT_DIPSETTING(      0x0020, DEF_STR( 4C_5C ))
  389.     PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C ))
  390.     PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ))
  391.     PORT_DIPSETTING(      0x0090, DEF_STR( 1C_3C ))
  392.     PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_4C ))
  393.     PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ))
  394.     PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ))
  395.     PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty ))
  396.     PORT_DIPSETTING(      0x0200, "Easy" )
  397.     PORT_DIPSETTING(      0x0000, "Normal" )
  398.     PORT_DIPSETTING(      0x0100, "Hard" )
  399.     PORT_DIPSETTING(      0x0300, "Hardest" )
  400.     PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Lives ))
  401.     PORT_DIPSETTING(      0x0000, "2" )
  402.     PORT_DIPSETTING(      0x0400, "3" )
  403.     PORT_DIPNAME( 0x0800, 0x0000, "Laser" )
  404.     PORT_DIPSETTING(      0x0000, "Manual" )
  405.     PORT_DIPSETTING(      0x0800, "Semi-Automatic" )
  406.     PORT_DIPNAME( 0x1000, 0x0000, "Extended Play" )
  407.     PORT_DIPSETTING(      0x0000, "500000 points" )
  408.     PORT_DIPSETTING(      0x1000, "None" )
  409.     PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ))
  410.     PORT_DIPSETTING(      0x0000, DEF_STR( Off ))
  411.     PORT_DIPSETTING(      0x2000, DEF_STR( On ))
  412.     PORT_DIPNAME( 0x4000, 0x0000, "Continues" )
  413.     PORT_DIPSETTING(      0x4000, DEF_STR( Off ))
  414.     PORT_DIPSETTING(      0x0000, DEF_STR( On ))
  415.     PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Flip_Screen ))
  416.     PORT_DIPSETTING(      0x0000, DEF_STR( Off ))
  417.     PORT_DIPSETTING(      0x8000, DEF_STR( On ))
  418. INPUT_PORTS_END
  419.  
  420.  
  421. INPUT_PORTS_START( rabiolep )
  422.     PORT_START    /* c0018 lower 8 bits */
  423.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  424.     PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  425.     PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  426.     PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  427.     PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  428.     PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
  429.     PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED )
  430.  
  431.     PORT_START    /* c001a lower 8 bits */
  432.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  433.     PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  434.     PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  435.     PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  436.     PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  437.     PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  438.     PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED )
  439.  
  440.     PORT_START    /* c0018/c001a upper 8 bits */
  441.     PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
  442.     PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
  443.     PORT_SERVICE( 0x0200, IP_ACTIVE_HIGH )
  444.     PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
  445.     PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_COIN2 )
  446.     PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_COIN1 )
  447.     PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START1 )
  448.     PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_START2 )
  449.     PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
  450.  
  451.     PORT_START    /* c001c DIP switches */
  452.     PORT_DIPNAME( 0x000f, 0x0000, DEF_STR( Coin_A ))
  453.     PORT_DIPSETTING(      0x000d, DEF_STR( 3C_1C ))
  454.     PORT_DIPSETTING(      0x000c, DEF_STR( 2C_1C ))
  455.     PORT_DIPSETTING(      0x0005, "6 Coins/4 Credits")
  456.     PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
  457.     PORT_DIPSETTING(      0x0003, "5 Coins/6 Credits" )
  458.     PORT_DIPSETTING(      0x0002, DEF_STR( 4C_5C ))
  459.     PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C ))
  460.     PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ))
  461.     PORT_DIPSETTING(      0x0009, DEF_STR( 1C_3C ))
  462.     PORT_DIPSETTING(      0x000a, DEF_STR( 1C_4C ))
  463.     PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ))
  464.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_6C ))
  465.     PORT_DIPNAME( 0x00f0, 0x0000, DEF_STR( Coin_B ))
  466.     PORT_DIPSETTING(      0x00d0, DEF_STR( 3C_1C ))
  467.     PORT_DIPSETTING(      0x00c0, DEF_STR( 2C_1C ))
  468.     PORT_DIPSETTING(      0x0050, "6 Coins/4 Credits")
  469.     PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
  470.     PORT_DIPSETTING(      0x0030, "5 Coins/6 Credits" )
  471.     PORT_DIPSETTING(      0x0020, DEF_STR( 4C_5C ))
  472.     PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C ))
  473.     PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ))
  474.     PORT_DIPSETTING(      0x0090, DEF_STR( 1C_3C ))
  475.     PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_4C ))
  476.     PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ))
  477.     PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ))
  478.     PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty ))
  479.     PORT_DIPSETTING(      0x0200, "Easy" )
  480.     PORT_DIPSETTING(      0x0000, "Normal" )
  481.     PORT_DIPSETTING(      0x0100, "Hard" )
  482.     PORT_DIPSETTING(      0x0300, "Hardest" )
  483.     PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Lives ))
  484.     PORT_DIPSETTING(      0x0400, "2" )
  485.     PORT_DIPSETTING(      0x0000, "3" )
  486.     PORT_DIPNAME( 0x0800, 0x0000, "Laser" )
  487.     PORT_DIPSETTING(      0x0800, "Manual" )
  488.     PORT_DIPSETTING(      0x0000, "Semi-Automatic" )
  489.     PORT_DIPNAME( 0x1000, 0x0000, "Extended Play" )
  490.     PORT_DIPSETTING(      0x0000, "500000 points" )
  491.     PORT_DIPSETTING(      0x1000, "300000 points" )
  492.     PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Demo_Sounds ))
  493.     PORT_DIPSETTING(      0x2000, DEF_STR( Off ))
  494.     PORT_DIPSETTING(      0x0000, DEF_STR( On ))
  495.     PORT_DIPNAME( 0x4000, 0x0000, "Continues" )
  496.     PORT_DIPSETTING(      0x4000, DEF_STR( Off ))
  497.     PORT_DIPSETTING(      0x0000, DEF_STR( On ))
  498.     PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Flip_Screen ))
  499.     PORT_DIPSETTING(      0x0000, DEF_STR( Off ))
  500.     PORT_DIPSETTING(      0x8000, DEF_STR( On ))
  501. INPUT_PORTS_END
  502.  
  503.  
  504.  
  505. INPUT_PORTS_START( svolley )
  506.     PORT_START    /* c0018 lower 8 bits */
  507.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  508.     PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  509.     PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  510.     PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  511.     PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  512.     PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
  513.     PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED )
  514.  
  515.     PORT_START    /* c001a lower 8 bits */
  516.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  517.     PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  518.     PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  519.     PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  520.     PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  521.     PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  522.     PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED )
  523.  
  524.     PORT_START    /* c0018/c001a upper 8 bits */
  525.     PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
  526.     PORT_BIT( 0x0700, IP_ACTIVE_HIGH, IPT_UNUSED )
  527.     PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_COIN2 )
  528.     PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_COIN1 )
  529.     PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START1 )
  530.     PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_START2 )
  531.     PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
  532.  
  533.     PORT_START    /* c001c DIP switches */
  534.     PORT_DIPNAME( 0x000f, 0x0000, DEF_STR( Coin_A ))
  535.     PORT_DIPSETTING(      0x000d, DEF_STR( 3C_1C ))
  536.     PORT_DIPSETTING(      0x000c, DEF_STR( 2C_1C ))
  537.     PORT_DIPSETTING(      0x0005, "6 Coins/4 Credits")
  538.     PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
  539.     PORT_DIPSETTING(      0x0003, "5 Coins/6 Credits" )
  540.     PORT_DIPSETTING(      0x0002, DEF_STR( 4C_5C ))
  541.     PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C ))
  542.     PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ))
  543.     PORT_DIPSETTING(      0x0009, DEF_STR( 1C_3C ))
  544.     PORT_DIPSETTING(      0x000a, DEF_STR( 1C_4C ))
  545.     PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ))
  546.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_6C ))
  547.     PORT_DIPNAME( 0x00f0, 0x0000, DEF_STR( Coin_B ))
  548.     PORT_DIPSETTING(      0x00d0, DEF_STR( 3C_1C ))
  549.     PORT_DIPSETTING(      0x00c0, DEF_STR( 2C_1C ))
  550.     PORT_DIPSETTING(      0x0050, "6 Coins/4 Credits")
  551.     PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
  552.     PORT_DIPSETTING(      0x0030, "5 Coins/6 Credits" )
  553.     PORT_DIPSETTING(      0x0020, DEF_STR( 4C_5C ))
  554.     PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C ))
  555.     PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ))
  556.     PORT_DIPSETTING(      0x0090, DEF_STR( 1C_3C ))
  557.     PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_4C ))
  558.     PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ))
  559.     PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ))
  560.     PORT_DIPNAME( 0x0100, 0x0000, "Game Time")
  561.     PORT_DIPSETTING(      0x0100, "2 min/1 min" )
  562.     PORT_DIPSETTING(      0x0000, "3 min/1.5 min" )
  563.     PORT_DIPNAME( 0x0600, 0x0000, "2P Starting Score" )
  564.     PORT_DIPSETTING(      0x0600, "0-0" )
  565.     PORT_DIPSETTING(      0x0400, "5-5" )
  566.     PORT_DIPSETTING(      0x0000, "7-7" )
  567.     PORT_DIPSETTING(      0x0200, "9-9" )
  568.     PORT_DIPNAME( 0x1800, 0x0000, "1P Starting Score" )
  569.     PORT_DIPSETTING(      0x1000, "9-11" )
  570.     PORT_DIPSETTING(      0x1800, "10-10" )
  571.     PORT_DIPSETTING(      0x0800, "10-11" )
  572.     PORT_DIPSETTING(      0x0000, "11-11" )
  573.     PORT_SERVICE( 0x2000, IP_ACTIVE_HIGH )
  574.     PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Demo_Sounds ))
  575.     PORT_DIPSETTING(      0x0000, DEF_STR( Off ))
  576.     PORT_DIPSETTING(      0x4000, DEF_STR( On ))
  577.     PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Flip_Screen ))
  578.     PORT_DIPSETTING(      0x0000, DEF_STR( Off ))
  579.     PORT_DIPSETTING(      0x8000, DEF_STR( On ))
  580. INPUT_PORTS_END
  581.  
  582.  
  583.  
  584. /*************************************
  585.  *
  586.  *    Graphics definitions
  587.  *
  588.  *************************************/
  589.  
  590. static struct GfxLayout bglayout =
  591. {
  592.     8,8,
  593.     12288,
  594.     4,
  595.     { 0, 1, 2, 3 },
  596.     { 4, 0, 12, 8, 20, 16, 28, 24 },
  597.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  598.     8*32
  599. };
  600.  
  601.  
  602. static struct GfxLayout splayout =
  603. {
  604.     16,32,
  605.     1536,
  606.     4,
  607.     { 0, 1, 2, 3 },
  608.     { 12, 8, 4, 0, 28, 24, 20, 16, 44, 40, 36, 32, 60, 56, 52, 48 },
  609.     { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
  610.             8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64,
  611.             16*64, 17*64, 18*64, 19*64, 20*64, 21*64, 22*64, 23*64,
  612.             24*64, 25*64, 26*64, 27*64, 28*64, 29*64, 30*64, 31*64 },
  613.     8*256
  614. };
  615.  
  616.  
  617. static struct GfxDecodeInfo gfxdecodeinfo[] =
  618. {
  619.     { REGION_GFX1, 0, &bglayout,   0, 16 },
  620.     { REGION_GFX2, 0, &bglayout, 256, 16 },
  621.     { REGION_GFX3, 0, &splayout,   0, 16*4 },
  622.     { -1 } /* end of array */
  623. };
  624.  
  625.  
  626.  
  627. /*************************************
  628.  *
  629.  *    Sound definitions
  630.  *
  631.  *************************************/
  632.  
  633. static struct YM2151interface ym2151_interface =
  634. {
  635.     1,            /* 1 chip */
  636.     MASTER_CLOCK/4,
  637.     { YM3012_VOL(50,MIXER_PAN_CENTER,50,MIXER_PAN_CENTER) },
  638.     { ym2151_irq_gen }
  639. };
  640.  
  641.  
  642. static struct UPD7759_interface upd7759_interface =
  643. {
  644.     1,            /* 1 chip */
  645.     UPD_CLOCK,
  646.     { 50 },
  647.     { REGION_SOUND1 },
  648.     UPD7759_STANDALONE_MODE,
  649.     { 0 }
  650. };
  651.  
  652.  
  653.  
  654. /*************************************
  655.  *
  656.  *    Machine driver
  657.  *
  658.  *************************************/
  659.  
  660. static struct MachineDriver machine_driver_rpunch =
  661. {
  662.     /* basic machine hardware */
  663.     {
  664.         {
  665.             CPU_M68000,
  666.             MASTER_CLOCK/2,
  667.             readmem,writemem,0,0,
  668.             ignore_interrupt,1
  669.         },
  670.         {
  671.             CPU_Z80,
  672.             MASTER_CLOCK/4,
  673.             readmem_sound,writemem_sound,0,0,
  674.             ignore_interrupt,1
  675.         }
  676.     },
  677.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  678.     1,
  679.     init_machine,
  680.  
  681.     /* video hardware */
  682.     304, 224, { 8, 303-8, 0, 223-8 },
  683.     gfxdecodeinfo,
  684.     1024,1024,
  685.     0,
  686.  
  687.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  688.     0,
  689.     rpunch_vh_start,
  690.     rpunch_vh_stop,
  691.     rpunch_vh_screenrefresh,
  692.  
  693.     /* sound hardware */
  694.     0,0,0,0,
  695.     {
  696.         {
  697.             SOUND_YM2151,
  698.             &ym2151_interface
  699.         },
  700.         {
  701.             SOUND_UPD7759,
  702.             &upd7759_interface
  703.         }
  704.     },
  705.     0
  706. };
  707.  
  708.  
  709.  
  710. /*************************************
  711.  *
  712.  *    ROM definitions
  713.  *
  714.  *************************************/
  715.  
  716. ROM_START( rpunch )
  717.     ROM_REGION( 0x20000, REGION_CPU1 )
  718.     ROM_LOAD_EVEN( "rpunch.20", 0x00000, 0x08000, 0xa2028d59 )
  719.     ROM_LOAD_ODD ( "rpunch.21", 0x00000, 0x08000, 0x1cdb13d3 )
  720.     ROM_LOAD_EVEN( "rpunch.2",  0x10000, 0x08000, 0x9b9729bb )
  721.     ROM_LOAD_ODD ( "rpunch.3",  0x10000, 0x08000, 0x5704a688 )
  722.  
  723.     ROM_REGION( 0x10000, REGION_CPU2 )
  724.     ROM_LOAD( "rpunch.92", 0x00000, 0x10000, 0x5e1870e3 )
  725.  
  726.     ROM_REGION( 0x60000, REGION_GFX1 )
  727.     ROM_LOAD( "rl_c13.bin", 0x00000, 0x40000, 0x7c8403b0 )
  728.     ROM_LOAD( "rl_c10.bin", 0x40000, 0x08000, 0x312eb260 )
  729.     ROM_LOAD( "rl_c12.bin", 0x48000, 0x08000, 0xbea85219 )
  730.  
  731.     ROM_REGION( 0x60000, REGION_GFX2 )
  732.     ROM_LOAD( "rl_a10.bin", 0x00000, 0x40000, 0xc2a77619 )
  733.     ROM_LOAD( "rl_a13.bin", 0x40000, 0x08000, 0xa39c2c16 )
  734.     ROM_LOAD( "rpunch.54",  0x48000, 0x08000, 0xe2969747 )
  735.  
  736.     ROM_REGION( 0x60000, REGION_GFX3 )
  737.     ROM_LOAD_GFX_EVEN( "rl_4g.bin", 0x00000, 0x20000, 0xc5cb4b7a )
  738.     ROM_LOAD_GFX_ODD ( "rl_4h.bin", 0x00000, 0x20000, 0x8a4d3c99 )
  739.     ROM_LOAD_GFX_EVEN( "rl_1g.bin", 0x40000, 0x08000, 0x74d41b2e )
  740.     ROM_LOAD_GFX_ODD ( "rl_1h.bin", 0x40000, 0x08000, 0x7dcb32bb )
  741.     ROM_LOAD_GFX_EVEN( "rpunch.85", 0x50000, 0x08000, 0x60b88a2c )
  742.     ROM_LOAD_GFX_ODD ( "rpunch.86", 0x50000, 0x08000, 0x91d204f6 )
  743.  
  744.     ROM_REGION( 0x60000, REGION_SOUND1 )
  745.     ROM_LOAD( "rl_f18.bin", 0x20000, 0x20000, 0x47840673 )
  746. //    ROM_LOAD( "rpunch.91", 0x00000, 0x0f000, 0x7512cc59 )
  747. ROM_END
  748.  
  749.  
  750. ROM_START( rabiolep )
  751.     ROM_REGION( 0x20000, REGION_CPU1 )
  752.     ROM_LOAD_EVEN( "rl_e2.bin", 0x00000, 0x08000, 0x7d936a12 )
  753.     ROM_LOAD_ODD ( "rl_d2.bin", 0x00000, 0x08000, 0xd8d85429 )
  754.     ROM_LOAD_EVEN( "rl_e4.bin", 0x10000, 0x08000, 0x5bfaee12 )
  755.     ROM_LOAD_ODD ( "rl_d4.bin", 0x10000, 0x08000, 0xe64216bf )
  756.  
  757.     ROM_REGION( 0x10000, REGION_CPU2 )
  758.     ROM_LOAD( "rl_f20.bin", 0x00000, 0x10000, 0xa6f50351 )
  759.  
  760.     ROM_REGION( 0x60000, REGION_GFX1 )
  761.     ROM_LOAD( "rl_c13.bin", 0x00000, 0x40000, 0x7c8403b0 )
  762.     ROM_LOAD( "rl_c10.bin", 0x40000, 0x08000, 0x312eb260 )
  763.     ROM_LOAD( "rl_c12.bin", 0x48000, 0x08000, 0xbea85219 )
  764.  
  765.     ROM_REGION( 0x60000, REGION_GFX2 )
  766.     ROM_LOAD( "rl_a10.bin", 0x00000, 0x40000, 0xc2a77619 )
  767.     ROM_LOAD( "rl_a13.bin", 0x40000, 0x08000, 0xa39c2c16 )
  768.     ROM_LOAD( "rl_a12.bin", 0x48000, 0x08000, 0x970b0e32 )
  769.  
  770.     ROM_REGION( 0x60000, REGION_GFX3 )
  771.     ROM_LOAD_GFX_EVEN( "rl_4g.bin", 0x00000, 0x20000, 0xc5cb4b7a )
  772.     ROM_LOAD_GFX_ODD ( "rl_4h.bin", 0x00000, 0x20000, 0x8a4d3c99 )
  773.     ROM_LOAD_GFX_EVEN( "rl_1g.bin", 0x40000, 0x08000, 0x74d41b2e )
  774.     ROM_LOAD_GFX_ODD ( "rl_1h.bin", 0x40000, 0x08000, 0x7dcb32bb )
  775.     ROM_LOAD_GFX_EVEN( "rl_2g.bin", 0x50000, 0x08000, 0x744903b4 )
  776.     ROM_LOAD_GFX_ODD ( "rl_2h.bin", 0x50000, 0x08000, 0x09649e75 )
  777.  
  778.     ROM_REGION( 0x60000, REGION_SOUND1 )
  779.     ROM_LOAD( "rl_f18.bin", 0x20000, 0x20000, 0x47840673 )
  780. ROM_END
  781.  
  782.  
  783. ROM_START( svolley )
  784.     ROM_REGION( 0x40000, REGION_CPU1 )
  785.     ROM_LOAD_EVEN( "sps_13.bin", 0x00000, 0x10000, 0x2fbc5dcf )
  786.     ROM_LOAD_ODD ( "sps_11.bin", 0x00000, 0x10000, 0x51b025c9 )
  787.     ROM_LOAD_EVEN( "sps_14.bin", 0x20000, 0x08000, 0xe7630122 )
  788.     ROM_LOAD_ODD ( "sps_12.bin", 0x20000, 0x08000, 0xb6b24910 )
  789.  
  790.     ROM_REGION( 0x10000, REGION_CPU2 )
  791.     ROM_LOAD( "sps_17.bin", 0x00000, 0x10000, 0x48b89688 )
  792.  
  793.     ROM_REGION( 0x60000, REGION_GFX1 )
  794.     ROM_LOAD( "sps_02.bin", 0x00000, 0x10000, 0x1a0abe75 )
  795.     ROM_LOAD( "sps_03.bin", 0x10000, 0x10000, 0x36279075 )
  796.     ROM_LOAD( "sps_04.bin", 0x20000, 0x10000, 0x7cede7d9 )
  797.     ROM_LOAD( "sps_01.bin", 0x30000, 0x08000, 0x6425e6d7 )
  798.     ROM_LOAD( "sps_10.bin", 0x40000, 0x08000, 0xa12b1589 )
  799.  
  800.     ROM_REGION( 0x60000, REGION_GFX2 )
  801.     ROM_LOAD( "sps_05.bin", 0x00000, 0x10000, 0xb0671d12 )
  802.     ROM_LOAD( "sps_06.bin", 0x10000, 0x10000, 0xc231957e )
  803.     ROM_LOAD( "sps_07.bin", 0x20000, 0x10000, 0x904b7709 )
  804.     ROM_LOAD( "sps_08.bin", 0x30000, 0x10000, 0x5430ffac )
  805.     ROM_LOAD( "sps_09.bin", 0x40000, 0x10000, 0x414a6278 )
  806.  
  807.     ROM_REGION( 0x60000, REGION_GFX3 )
  808.     ROM_LOAD_GFX_EVEN( "sps_20.bin", 0x00000, 0x10000, 0xc9e7206d )
  809.     ROM_LOAD_GFX_ODD ( "sps_23.bin", 0x00000, 0x10000, 0x7b15c805 )
  810.     ROM_LOAD_GFX_EVEN( "sps_19.bin", 0x20000, 0x08000, 0x8ac2f232 )
  811.     ROM_LOAD_GFX_ODD ( "sps_22.bin", 0x20000, 0x08000, 0xfcc754e3 )
  812.     ROM_LOAD_GFX_EVEN( "sps_18.bin", 0x30000, 0x08000, 0x4d6c8f0c )
  813.     ROM_LOAD_GFX_ODD ( "sps_21.bin", 0x30000, 0x08000, 0x9dd28b42 )
  814.  
  815.     ROM_REGION( 0x60000, REGION_SOUND1 )
  816.     ROM_LOAD( "sps_16.bin", 0x20000, 0x20000, 0x456d0f36 )
  817.     ROM_LOAD( "sps_15.bin", 0x40000, 0x10000, 0xf33f415f )
  818. ROM_END
  819.  
  820.  
  821. ROM_START( svolleyk )
  822.     ROM_REGION( 0x40000, REGION_CPU1 )
  823.     ROM_LOAD_EVEN( "a14.bin", 0x00000, 0x10000, 0xdbab3bf9 )
  824.     ROM_LOAD_ODD ( "a11.bin", 0x00000, 0x10000, 0x92afd56f )
  825.     ROM_LOAD_EVEN( "a15.bin", 0x20000, 0x08000, 0xd8f89c4a )
  826.     ROM_LOAD_ODD ( "a12.bin", 0x20000, 0x08000, 0xde3dd5cb )
  827.  
  828.     ROM_REGION( 0x10000, REGION_CPU2 )
  829.     ROM_LOAD( "sps_17.bin", 0x00000, 0x10000, 0x48b89688 )
  830.  
  831.     ROM_REGION( 0x60000, REGION_GFX1 )
  832.     ROM_LOAD( "sps_02.bin", 0x00000, 0x10000, 0x1a0abe75 )
  833.     ROM_LOAD( "sps_03.bin", 0x10000, 0x10000, 0x36279075 )
  834.     ROM_LOAD( "sps_04.bin", 0x20000, 0x10000, 0x7cede7d9 )
  835.     ROM_LOAD( "sps_01.bin", 0x30000, 0x08000, 0x6425e6d7 )
  836.     ROM_LOAD( "sps_10.bin", 0x40000, 0x08000, 0xa12b1589 )
  837.  
  838.     ROM_REGION( 0x60000, REGION_GFX2 )
  839.     ROM_LOAD( "sps_05.bin", 0x00000, 0x10000, 0xb0671d12 )
  840.     ROM_LOAD( "sps_06.bin", 0x10000, 0x10000, 0xc231957e )
  841.     ROM_LOAD( "sps_07.bin", 0x20000, 0x10000, 0x904b7709 )
  842.     ROM_LOAD( "sps_08.bin", 0x30000, 0x10000, 0x5430ffac )
  843.     ROM_LOAD( "sps_09.bin", 0x40000, 0x10000, 0x414a6278 )
  844.     ROM_LOAD( "a09.bin",    0x50000, 0x08000, 0xdd92dfe1 )
  845.  
  846.     ROM_REGION( 0x60000, REGION_GFX3 )
  847.     ROM_LOAD_GFX_EVEN( "sps_20.bin", 0x00000, 0x10000, 0xc9e7206d )
  848.     ROM_LOAD_GFX_ODD ( "sps_23.bin", 0x00000, 0x10000, 0x7b15c805 )
  849.     ROM_LOAD_GFX_EVEN( "sps_19.bin", 0x20000, 0x08000, 0x8ac2f232 )
  850.     ROM_LOAD_GFX_ODD ( "sps_22.bin", 0x20000, 0x08000, 0xfcc754e3 )
  851.     ROM_LOAD_GFX_EVEN( "sps_18.bin", 0x30000, 0x08000, 0x4d6c8f0c )
  852.     ROM_LOAD_GFX_ODD ( "sps_21.bin", 0x30000, 0x08000, 0x9dd28b42 )
  853.  
  854.     ROM_REGION( 0x60000, REGION_SOUND1 )
  855.     ROM_LOAD( "sps_16.bin", 0x20000, 0x20000, 0x456d0f36 )
  856.     ROM_LOAD( "sps_15.bin", 0x40000, 0x10000, 0xf33f415f )
  857. ROM_END
  858.  
  859.  
  860.  
  861. /*************************************
  862.  *
  863.  *    Driver initialization
  864.  *
  865.  *************************************/
  866.  
  867. static void init_rabiolep(void)
  868. {
  869.     rpunch_sprite_palette = 0x300;
  870.  
  871.     /* clear out any unused regions of background gfx */
  872.     memset(memory_region(REGION_GFX1) + 0x50000, 0xff, 0x10000);
  873.     memset(memory_region(REGION_GFX2) + 0x50000, 0xff, 0x10000);
  874. }
  875.  
  876.  
  877. static void init_svolley(void)
  878. {
  879.     /* the main differences between Super Volleyball and Rabbit Punch are */
  880.     /* the lack of direct-mapped bitmap, a smaller sprite range, and a */
  881.     /* different palette base for sprites */
  882.     rpunch_sprite_palette = 0x080;
  883.     rpunch_bitmapram = NULL;
  884.     spriteram_size = 0x1b0;
  885.  
  886.     /* clear out any unused regions of background gfx */
  887.     memset(memory_region(REGION_GFX1) + 0x38000, 0xff, 0x08000);
  888.     memset(memory_region(REGION_GFX1) + 0x48000, 0xff, 0x18000);
  889.     memset(memory_region(REGION_GFX2) + 0x50000, 0xff, 0x10000);
  890. }
  891.  
  892.  
  893. static void init_svolleyk(void)
  894. {
  895.     /* the main differences between Super Volleyball and Rabbit Punch are */
  896.     /* the lack of direct-mapped bitmap, a smaller sprite range, and a */
  897.     /* different palette base for sprites */
  898.     rpunch_sprite_palette = 0x080;
  899.     rpunch_bitmapram = NULL;
  900.     spriteram_size = 0x1b0;
  901.  
  902.     /* clear out any unused regions of background gfx */
  903.     memset(memory_region(REGION_GFX1) + 0x38000, 0xff, 0x08000);
  904.     memset(memory_region(REGION_GFX1) + 0x48000, 0xff, 0x18000);
  905.     memset(memory_region(REGION_GFX2) + 0x58000, 0xff, 0x08000);
  906. }
  907.  
  908.  
  909.  
  910. /*************************************
  911.  *
  912.  *    Game drivers
  913.  *
  914.  *************************************/
  915.  
  916. GAME( 1987, rabiolep, 0,        rpunch,   rabiolep, rabiolep, ROT0, "V-System Co.", "Rabio Lepus (Japan)" )
  917. GAME( 1987, rpunch,   rabiolep, rpunch,   rpunch,   rabiolep, ROT0, "V-System Co. (Bally/Midway/Sente license)", "Rabbit Punch (US)" )
  918. GAME( 1989, svolley,  0,        rpunch,   svolley,  svolley,  ROT0, "V-System Co.", "Super Volleyball (Japan)" )
  919. GAME( 1989, svolleyk, svolley,  rpunch,   svolley,  svolleyk, ROT0, "V-System Co.", "Super Volleyball (Korea)" )
  920.